﻿@model IList<BlogPostYearModel>
@if (Model.Any())
{
    <section id="block-blog-archive" class="block block-blog-archive">
        <h2 class="h5">
            <strong>@Loc["Blog.Archive"]</strong>
        </h2>
        <div class="viewBox">
            <ul class="list" id="blog-month-list">
                @foreach (var yearItem in Model)
                {
                    <li class="year">
                        <strong class="number">@(yearItem.Year)</strong>
                        <ul class="sublist" id="blog-year-@(yearItem.Year)">
                            @foreach (var monthItem in yearItem.Months)
                            {
                                <li class="month">
                                    <a href="@Url.RouteUrl("BlogByMonth", new { month = yearItem.Year + "-" + monthItem.Month })">
                                        @(new DateTime(yearItem.Year, monthItem.Month, 1).ToString("MMMM"))
                                        (@(monthItem.BlogPostCount))
                                    </a>
                                </li>
                            }
                        </ul>
                    </li>
                }
            </ul>
        </div>
    </section>
}